package cn.peifu.hrm.exception.code;

//封装错误码
public enum ErrorCode {
    //不可为空的错误码
    CODE_100_NULL_COMPANYNAME(100,"公司名不可为空"),
    CODE_101_NULL_USERNAME(101,"用户名不可为空"),
    CODE_102_COMPANYNUM_ILLEGAL(102,"无效的公司信用码"),
    CODE_103_FORMAT_INVALID_PHONE(103,"无效的手机格式"),
    CODE_104_EXIST_COMPANYNAME(104,"公司名已经被注册"),
    CODE_105_FAIL_PARAM(105,"非法参数"),
    CODE_200_NULL_COURSE(200,"课程不可为空"),
    CODE_201_NULL_COURSE_DETAIL(201,"课程详情不可为空"),
    CODE_202_NULL_COURSE_MARKET(202,"课程价格不可为空"),
    CODE_203_NULL_COURSE_ISEXIST(203,"课程已存在"),
    CODE_204_NULL_COURSE_ID(204,"参数非法！");

    //错误码
    private  int code;
    //错误信息
    private  String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    ErrorCode() {
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return "["+code+"]"+ message;
    }
}